package dialogos;
import java.awt.FlowLayout;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.util.ArrayList;
import java.util.Hashtable;
import java.util.List;
import javax.swing.BorderFactory;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.SwingUtilities;
import javax.swing.border.LineBorder;

import accesoADatos.AccesoADatos;
import datos.Profesional;


/**
* This code was edited or generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
*/
public abstract class BorrarDialog extends javax.swing.JDialog {
	protected JComboBox jComboBox1;
	protected JButton jButton1;
	protected JButton jButton2;
	private List lista;
	protected Hashtable hash=new Hashtable();

	/**
	* Auto-generated main method to display this JDialog
	*/
	public static void main(String[] args) {
		SwingUtilities.invokeLater(new Runnable() {
			public void run() {
				JFrame frame = new JFrame();
		//		BorrarDialog inst = new BorrarDialog(frame,new ArrayList(),"");
		//		inst.setVisible(true);
			}
		});
	}
	
	public BorrarDialog(JFrame frame, List lista, String titulo) {
		super(frame,titulo,true);
		this.lista=lista;
		initGUI();
		
	}
	
	@SuppressWarnings("unchecked")
	private void initGUI() {
		try {
			{
				jComboBox1 = new JComboBox();
				getContentPane().add(jComboBox1);
				jComboBox1.setPreferredSize(new java.awt.Dimension(163, 21));
				jComboBox1.setBorder(new LineBorder(new java.awt.Color(0,0,0), 1, false));
				FlowLayout thisLayout = new FlowLayout();
				getContentPane().setLayout(thisLayout);
				for(int i=0; i<lista.size();i++){
					hash.put(lista.get(i).toString(),lista.get(i));
					jComboBox1.addItem(lista.get(i));
					}
			}
			{
				jButton1 = new JButton();
				getContentPane().add(jButton1);
				jButton1.setText("Borrar");
				jButton1.setPreferredSize(new java.awt.Dimension(100, 25));
				jButton1.addMouseListener(new MouseAdapter() {
					public void mouseClicked(MouseEvent evt) {
						jButton1MouseClicked(evt);
					}
				});
			}
			{
				jButton2 = new JButton();
				getContentPane().add(jButton2);
				jButton2.setText("Cancelar");
				jButton2.setPreferredSize(new java.awt.Dimension(100, 25));
				jButton2.addMouseListener(new MouseAdapter() {
					public void mouseClicked(MouseEvent evt) {
						jButton2MouseClicked(evt);
					}
				});
			}
			pack();
			this.setSize(280, 100);
			this.setLocationRelativeTo(null);
			this.setVisible(true);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	protected abstract void jButton1MouseClicked(MouseEvent evt); 
	
	protected void jButton2MouseClicked(MouseEvent evt) {
		this.dispose();	
	}

}
